#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>


/* buttondrvtest on
 * buttondrvtest off
 */
int main(int argc, char **argv)
{
	int fd;
	int ret = 0;
	unsigned char key_val;
	int count = 0;
	
	fd = open("/dev/button", O_RDWR);
	if (fd < 0){
		printf("can't open!\n");
		return -1;
	}

	while(1){
		ret = read(fd, &key_val, 1);
		if(ret < 0){
			printf(" func read() err\n");
		}else{
			printf("key_val = 0x%x\n", key_val);
			}
	}
	
	return ret;
}
